package com.coreJava.xianchengchi.testForDingShiPool;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 作者: LCG
 * 日期: 2020/2/10 22:55
 * 描述: 使用定时线程池做一个
 */
public class TestForChongShi {

    private static ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

    public static void chongshi(){

        TestSchRunable testSchRunable=new TestSchRunable(scheduledExecutorService);
        scheduledExecutorService.scheduleWithFixedDelay(testSchRunable,0,3,TimeUnit.SECONDS);

    }

}
